<template>
  <view>
    <!-- 页面内容 -->
    <view @click="navigateToPage('integralDetail')">积分明细</view>
    <view @click="navigateToPage('integralTask')">积分任务</view>
    <view @click="navigateToPage('signIn')">签到</view>
    <!-- 自定义 tabBar 组件 -->
    <CustomTabBar :currentTab="currentTab" @tabChange="handleTabChange" />
  </view>
</template>

<script>
import CustomTabBar from '@/uni_modules/jorbin-DigHoleNavigationBar/components/CustomTabBar/CustomTabBar.vue';

export default {
  components: {
    CustomTabBar
  },
  data() {
    return {
      currentTab: 0
    };
  },
  methods: {
    handleTabChange(index) {
      this.currentTab = index;
    },
    navigateToPage(pageName) {
      let url = '';
      switch (pageName) {
        case 'integralDetail':
          url = '/packagesJiFen/ShangpinDetail/ShangpinDetail'; // 替换为实际的积分明细页面路径
          break;
        case 'integralTask':
          url = '/packagesJiFen/JiFenRenWu/JiFenRenWu'; // 替换为实际的积分任务页面路径
          break;
        case 'signIn':
          url = '/packagesJiFen/JiFenQianDao'; // 替换为实际的签到页面路径
          break;
        default:
          break;
      }
      if (url) {
        uni.navigateTo({
          url: url
        });
      }
    }
  }
};
</script>

<style scoped>
/* 页面样式 */
.view {
  cursor: pointer; /* 鼠标指针变为手型，提示可点击 */
  padding: 10px;
  border-bottom: 1px solid #ccc;
}
</style>